Skip to content

Warn for typo'd folders #399 - #479

Merged
pehrsoderman merged 3 commits into
Kattis:masterfrom
gkreitz:399_warn_typod_folders
Aug 28, 2026
Merged

Warn for typo'd folders #399#479
pehrsoderman merged 3 commits into
Kattis:masterfrom
gkreitz:399_warn_typod_folders

Conversation

@gkreitz

@gkreitz gkreitz commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Adds a check looking at directories in the root of the problem package, warning for unknown directories (and suggesting the closest known match, if anything is close). This check replaces 3 bespoke checks for the same thing in various places.

Drops the check for unknown directories in submissions/. I covered this warning when extracting submission checks (we now look in all directories for submissions, and will warn about unknown submissions), so it's now basically a duplicate.

Renames the variable/function parameter format to format_version to avoid shadowing the built-in.

Fixes #399

@pehrsoderman
pehrsoderman merged commit 0a497bc into Kattis:master Aug 28, 2026
7 checks passed
@simonlindholm

Copy link
Copy Markdown
Member

This feels a bit overaggressive to me, adding warnings that you can't silence without (IMO) a clear upside (I can't think of a bug that this would have caught).

For example, for Swedish IOI qualifiers we regularly use a directory /manual-tests/ where we put handcrafted testcases that /data/generator.sh then copies into /data/.

I've also in the recent past used directories like old_submissions/ for trashing submissions that don't fit in submissions/ (e.g. because of unstable verdicts, or because we changed the problem but didn't update solutions), and kept various temp folders around for dev purposes.

@Tagl

Tagl commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Yeah I thought the idea was to catch levenshtein distance 1 or 2 typo errors, not warn on arbitrary directories.
This will be rather annoying in current form for any sort of development.

@gkreitz

gkreitz commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

without (IMO) a clear upside (I can't think of a bug that this would have caught).

I think the upside is exactly the example given in the issue, catching stuff like calling a directory attachment instead of attachments (which is very easy to miss).

But, good points. I'll look at tweaking to allow for more clutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn for typo'd folders

4 participants